#variables
git_repo=${PWD##*/}
git_repo=${Current_Dir:-/}
gitee="https://gitee.com/hwaust/"
url="http://121.199.10.158:8107/ebooks/"

echo "本代码主要包括三大功能："
echo "1. 提交版本 git commit"
echo "2. 代码上传 git push"
echo "3. 远程编译 git pull & gitbook build"

# 更新并上传代码
git add .
git commit -m "$1"
git push

# 上传
echo "updating : $gitee$git_repo"
echo "visit url: $url$git_repo/_book/"
ssh ali "cd /root/myweb/ROOT/ebooks/ebook-$git_repo; pwd; ./build.sh"

# sleep for 5s 用于显示
sleep 5s